home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 41 / Amiga Format CD41 (1999-06)(Future Publishing)(GB)[!][issue 1999-07].iso / -seriously_amiga- / programming / other / gui4cli / tools / rtn / rexxcheck.g < prev    next >
Text File  |  1999-04-29  |  2KB  |  85 lines

  1. G4C
  2.  
  3. ; RexxCheck.g
  4.  
  5. ; Routine to make sure that rexxmast has been launched and that
  6. ; RX and WaitForPort have been made resident.
  7.  
  8. ; Only really needed if G4C is run from the WB directly (not through c:gui)
  9.  
  10. ; Before calling it, check if variable $*REXXOK = 1. 
  11. ; If it is, it means that this routine has already been run successfuly.
  12. ; .. do something like this..
  13.  
  14. ; if $*REXXOK != 1           ; check if rexxcheck.g has been run
  15. ;    guiload guis/tools/rtn/rexxcheck.g
  16. ;    if $*REXXOK != 1        ; quit if rexxcheck failed
  17. ;        stop
  18. ;    endif
  19. ; endif
  20. ; run 'rx MyFile'
  21.  
  22.  
  23. xOnLoad
  24.  
  25. if $*REXXOK = 1            ; rexxcheck.g has already been run
  26.    guiquit rexxcheck.g
  27.    stop
  28. endif
  29.  
  30. ifexists file rexxmast          ; means that Gui4Cli knows default paths
  31.    ifexists file rx             ; so no need for this
  32.       *REXXOK = 1
  33.       guiquit rexxcheck.g
  34.       stop
  35.    endif
  36. endif
  37.  
  38. *REXXOK    = 0
  39.  
  40. ; Check for RexxMast
  41.  
  42. ifexists port REXX
  43.    ; ok - rexxmast already loaded
  44. else
  45.    ifexists file sys:system/rexxmast
  46.        run 'sys:system/rexxmast'
  47.    else
  48.        ezreq "RexxMast not found\nplease start it manually\nand try again" OK ""
  49.        guiquit rexxcheck.g
  50.        stop
  51.    endif
  52.    wait port REXX 50
  53.    if $$RETCODE > 0
  54.        ezreq 'Could not run RexxMast!' ABORT ""
  55.        guiquit rexxcheck.g
  56.        stop
  57.    endif
  58. endif
  59.  
  60. ; Make RX resident
  61.  
  62. ifexists file sys:rexxc/rx
  63.    run 'resident sys:rexxc/rx pure add'
  64. else
  65.    ezreq 'Sys:rexxc/RX not found!\nI need it to run ARexx.' OK ''
  66.    guiquit rexxcheck.g
  67.    stop
  68. endif
  69.  
  70. ; Make WaitForPort resident
  71.  
  72. ifexists file sys:rexxc/waitforport
  73.    run 'resident sys:rexxc/waitforport pure add'
  74. else
  75.    ezreq 'Sys:rexxc/WaitForport not found!\nI need it to run ARexx.' OK ''
  76.    guiquit rexxcheck.g
  77.    stop
  78. endif
  79.  
  80. ; Everything allright
  81.  
  82. *REXXOK = 1
  83. guiquit rexxcheck.g
  84.  
  85.